<template>
	<view class="u-page">
	<nav-bar title="车辆档案详情"></nav-bar>
		<view class="u-page__item">
			<uni-list>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">单位名称</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.companyname}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">车牌号</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.carname}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">录入时间</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.created}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">厂牌型号</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.carbrandsys}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">车辆类型</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.carmodel}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">车辆种类</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.cartype}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">车架号（后6位）</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.vin}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">排量</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.caroutput}}</text>
					</template>
				</uni-list-item><uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">座位数</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.seats}}</text>
					</template>
				</uni-list-item><uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">排放标准</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.effluentstandard}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">发动机号（后6位）</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.enginenumber}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">购置价格（万元）</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.buyprice}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">车辆颜色</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.carcolor}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">产地</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.carmade}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">登记时间</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.buydate}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">行驶里程（公里）</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.mileage}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">维修次数</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.modifyNum}}</text>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:header>
						<text class="slot-box slot-title">备注</text>
					</template>
					<template v-slot:footer>
						<text class="slot-content">{{unitObject.memo}}</text>
					</template>
				</uni-list-item>
			</uni-list>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import { getCarDetail } from '@/api/use';
	import NavBar from '@/components/NavBar.vue';
	const unitId = ref('')
	const unitObject = ref({
		
	})
	// 通过事件通道获取单位id
	onLoad((option) => {
		unitId.value = option.id
		serverCarDetail()
	})
	
	function serverCarDetail(){
		let params = {
			cid:unitId.value
		}
		getCarDetail(params).then(res => {
			if(res.code === 1){
				unitObject.value = res.data;
			}else{
				
			}
		})
	}

</script>

<style lang="scss" scoped>
	.u-page {
		padding: 0;

		&__item {
			background-color: #fff;

			&__list {
				display: flex;
				justify-content: space-between;
				margin-bottom: 10px;
				color: #797E84;
				font-size: 13px;

				&__title {
					color: #333;
					font-size: 14px;
				}
			}


			&__title {
				color: #333;
				background-color: #fff;
				padding: 15px;
				font-size: 15px;

				&__slot-title {

					font-size: 14px;
				}
			}

			&__table {
				&__item {
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding: 15px;
					flex: 1;

					&__left {
						color: #797E84;
						font-size: 13px;
					}

					&__right {
						display: flex;
						justify-content: space-around;
						align-items: center;
						color: #333;
						font-size: 14px;

						&__box {
							width: 40px;
							height: 40px;

							text-align: center;

						}
					}
				}
			}
		}
	}

	.u-collapse-content {

		font-size: 14px;
	}
	.slot-content{
		font-size: 16px;
		color: #333;
		float: right;
	}
	.slot-title{
		font-size: 16px;
		color: #999;
	}
</style>